<template>
  <div class="qualityteam-container">
    <!-- 顶部标题 -->
    <el-row justify="center" class="header-row">
      <el-col :span="24" class="title">质量日报概览</el-col>
    </el-row>

    <!-- 主指标情况 -->
    <el-row :gutter="16" class="main-tables">
      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="card-title">主指标情况</div>
          <el-table :data="mainTargetData" border size="small">
            <el-table-column prop="item" label="区域" align="center" />
            <el-table-column label="原品种一次合格率（%）" align="center" >
            <el-table-column prop="A" label="目标" width="70" />
            <el-table-column prop="B" label="当日" width="70" />
            <el-table-column prop="C" label="累计" width="70" />
          </el-table-column>
            <el-table-column label="废次降率（%）" align="center" >
              <el-table-column prop="D" label="目标" width="70" />
              <el-table-column prop="E" label="当日" width="70" />
              <el-table-column prop="F" label="累计" width="70" />
            </el-table-column>
          </el-table>
        </el-card>
       
      
      </el-col>

      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <!-- <div class="card-title">成次降/详情</div> -->
          <div class="tcm1-mid-mid-card2-graph common-div-card">
              <graph-bar-other
                :data1="speProdSteel1"
                :data2="speProdSteel2"
                :datax="speProdSteelx"
                :title="'原品种一次合格率（%）'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col>

      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <!-- <div class="card-title">成次降/详情</div> -->
          <div class="tcm1-mid-mid-card2-graph common-div-card">
              <graph-bar-other
                :data1="speProdSteel1"
                :data2="speProdSteel2"
                :datax="speProdSteelx"
                :title="'废次降率（%）'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col>
    </el-row>

     <!-- 主体指标完成情况 折线图 -->
     <el-row :gutter="16" class="sub-tables">
      <el-col :span="8">
        <el-card class="tcm1-right-mid-card2" shadow="hover">
            <div style="width: 100%; height: 100%">
              <graph-line 
              :data1="tcmELCCPKData1" 
              :datax="tcmELCCPKDatax" 
              :data-name="tcmELCCPKDataName1" 
              :title="'原品种一次合格率趋势（%）各个单元'"
              :max="102"
              :min="88" />
            </div>
          </el-card>
      </el-col>

      <el-col :span="8">
        <el-card class="tcm1-right-mid-card2" shadow="hover">
            <div style="width: 100%; height: 100%">
              <graph-line 
              :data1="tcmELCCPKData2" 
              :datax="tcmELCCPKDatax" 
              :data-name="tcmELCCPKDataName2" 
              :title="'废次降率趋势（%）各个单元'"
              :max="102"
              :min="88" />
            </div>
          </el-card>
        </el-col>

        <el-col :span="8">
        <el-card class="tcm1-right-mid-card2" shadow="hover">
            <div style="width: 100%; height: 100%">
              <graph-line 
              :data1="tcmELCCPKData3" 
              :datax="tcmELCCPKDatax" 
              :data-name="tcmELCCPKDataName2" 
              :title="'封闭趋势（吨）各个单元'"
              :max="102"
              :min="88" />
            </div>
          </el-card>
        </el-col>

    </el-row>


    <!-- 汽车板生产情况 -->
    <el-row :gutter="16" class="sub-tables">
      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="card-title">汽车板生产情况</div>
          <el-table :data="CarData" border size="small">
            <el-table-column prop="car_a" label="类别" />
            <el-table-column prop="car_b" label="指标" />
            <el-table-column prop="car_c" label="当日" />
            <el-table-column prop="car_d" label="累计" />
          </el-table>
        </el-card>
      </el-col>

      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="tcm1-mid-mid-card2-graph common-div-card">
              <graph-bar-other
                :data1="CarSteel1"
                :data2="CarSteel2"
                :data3="CarSteel3"
                :datax="CarSteelx"
                :title="'汽车板合格率（%）'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col>

      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="tcm1-mid-mid-card2-graph common-div-card">
              <graph-bar-other
                :data1="speProdSteel1"
                :data2="speProdSteel2"
                :datax="speProdSteelx"
                :title="'汽车板残次率（%）'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col>

    </el-row>

    <!-- 原料质量影响 -->
    <el-row :gutter="16" class="main-tables">
      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="card-title">原料质量影响</div>
          <el-table :data="qualitytData" border size="small">
            <el-table-column prop="item" label="类型" align="center" />
            <el-table-column label="板材炼钢" align="center" >
              <el-table-column prop="A1" label="当日" width="70" />
              <el-table-column prop="A2" label="累计" width="70" />
            </el-table-column>
            <el-table-column label="板材热轧" align="center" >
              <el-table-column prop="B1" label="当日" width="70" />
              <el-table-column prop="B2" label="累计" width="70" />
            </el-table-column>
            <el-table-column label="北营炼钢" align="center" >
              <el-table-column prop="C1" label="当日" width="70" />
              <el-table-column prop="C2" label="累计" width="70" />
            </el-table-column>
            <el-table-column label="北营热轧" align="center" >
              <el-table-column prop="D1" label="当日" width="70" />
              <el-table-column prop="D2" label="累计" width="70" />
            </el-table-column>
          </el-table>
        </el-card>
      </el-col>

      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="tcm1-mid-mid-card2-graph common-div-card">
              <graph-bar-other
                :data1="qualitytDataPicDay1"
                :data2="qualitytDataPicDay2"
                :data3="qualitytDataPicDay3"
                :datax="qualitytDataPicDayx"
                :title="'当日外部降级情况(吨)'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col>

      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="tcm1-mid-mid-card2-graph common-div-card">
            <graph-bar-other
                :data1="qualitytDataPicMonth1"
                :data2="qualitytDataPicMonth2"
                :data3="qualitytDataPicMonth3"
                :datax="qualitytDataPicMonthx"
                :title="'月累外部降级情况(吨)'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col>

    </el-row>


     <!-- 汽车板生产情况 -->
     <el-row :gutter="16" class="sub-tables">
      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="tcm1-mid-mid-card2-graph common-div-card">
              <graph-bar-other
                :data1="speProdSteel1"
                :data2="speProdSteel2"
                :datax="speProdSteelx"
                :title="'汽车板残次率（%）'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col>

      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="tcm1-mid-mid-card2-graph common-div-card">
              <graph-bar-other
                :data1="CarSteel1"
                :data2="CarSteel2"
                :data3="CarSteel3"
                :datax="CarSteelx"
                :title="'当日外部返工情况(吨)'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col>

      <el-col :span="8">
        <el-card shadow="hover" class="stat-card">
          <div class="tcm1-mid-mid-card2-graph common-div-card">
              <graph-bar-other
                :data1="speProdSteel1"
                :data2="speProdSteel2"
                :datax="speProdSteelx"
                :title="'月累外部返工情况(吨)'"
                :max="10000"
                :min="0"
              />
            </div>
        </el-card>
      </el-col>

    </el-row>

  </div>
</template>

<script setup lang="ts">
  import { ref } from 'vue';

  import GraphBarOther from '../components/GraphBarOther.vue';
  import GraphLine from '../components/GraphLine.vue';


//主指标情况，表格数据
  const mainTargetData = [
    { item: '一冷', A: 100, B: 110, C: 120, D: 130, E: 460,F:520 },
    { item: '三冷', A: 98, B: 112, C: 119, D: 128, E: 457 ,F:517 },
    { item: '总厂', A: 10, B: 12, C: 8, D: 15, E: 45,F:534 },
  ];

  //主指标情况，柱状图数据center
  const speProdSteel1 = ref<any>([5475, 8547, 3254]); // 7456, 7456, 7456, 7456
  const speProdSteel2 = ref<any>([7456, 3247, 5589]); // 7456, 7456, 7456, 7456
  const speProdSteelx = ref<any>(['一冷', '三冷', '总厂']);


  //汽车板生产情况，表格数据
  const CarData = [
    { car_a: '内板', car_b: 156, car_c: 151, car_d: 547 },
    { car_a: '外板', car_b: 257, car_c: 255, car_d: 874 },
    { car_a: '合计', car_b: 478, car_c: 398, car_d: 1375 },
  ];

  //汽车板生产情况，表格数据
  const CarSteel1 = ref<any>([156, 151, 547]);
  const CarSteel2 = ref<any>([257, 255, 874]); 
  const CarSteel3 = ref<any>([478, 398, 1375]); 
  const CarSteelx   = ref<any>(['内板', '外板', '合计']);
  
  
  //原料质量影响，表格数据
  const qualitytData = [
    { item: '降级', A1: 100, A2: 110, B1: 120, B2: 130, C1: 460,C2:520 , D1: 120, D2: 130},
    { item: '封闭返工', A1: 100, A2: 110, B1: 120, B2: 130, C1: 460,C2:520 , D1: 120, D2: 130},
    { item: '合计', A1: 200, A2: 220, B1: 240, B2: 260, C1: 940,C2:1040 , D1: 2400, D2: 360},
  ];

  
    //原料质量影响，当日外部降级情况(吨)数据
  const qualitytDataPicDay1 = ref<any>([156, 151, ,257,547]);
  const qualitytDataPicDay2 = ref<any>([257, 255,324, 874]); 
  const qualitytDataPicDay3 = ref<any>([478, 398, 412,1375]); 
  const qualitytDataPicDayx   = ref<any>(['板材炼钢', '板材热轧', '北营炼钢', '北营热轧']);

  
  //原料质量影响，当日外部降级情况(吨)数据
  const qualitytDataPicMonth1 = ref<any>([156, 151, ,257,547]);
  const qualitytDataPicMonth2 = ref<any>([257, 255,324, 874]); 
  const qualitytDataPicMonth3 = ref<any>([478, 398, 412,1375]); 
  const qualitytDataPicMonthx   = ref<any>(['板材炼钢', '板材热轧', '北营炼钢', '北营热轧']);

  //主指标情况 折线图
  const tcmELCCPKData1 = ref<any>([98, 100, 92, 96,102]);
  const tcmELCCPKData2 = ref<any>([89, 88, 98, 95,101]);
  const tcmELCCPKData3 = ref<any>([97, 88, 96, 99,89]);
  const tcmELCCPKDatax = ref<any>(['7月22日', '7月23日', '7月24日', '7月25日', '7月26日']);
  const tcmELCCPKDataName1 = ref<any>(['']);//合格率
  const tcmELCCPKDataName2 = ref<any>(['']);//废次率

  onBeforeMount(() => {});
</script>

<style lang="less" scoped>
  @border-radius: 8px;
  @primary-color: #2c69e8;
  @box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  @box-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.12);
  @border:1px solid #dcdfe6;

  
  .tcm1-right-mid-card2 {
    width: 100%;
    height: 25vh;
    flex-wrap: nowrap;
    margin-top: 1vh;
    margin-bottom: 3vh;

    :deep(.el-card__body) {
      display: flex;
      justify-content: space-between;
      width: 100%;
      height: 100%;
    }
  }

  .qualityteam-container {
    padding: 18px 18px 0 18px;
    background: #f6f8fa;
  }
  .header-row .title {
    font-size: 2rem;
    font-weight: bold;
    color: #009966;
    letter-spacing: 0.5em;
    text-align: center;
    margin-bottom: 18px;
  }
  .card-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
  .stat-card {
    margin-bottom: 16px;
  }
  .device-issue-row {
    margin-bottom: 16px;
  }
  .device-issue-card {
    background: #fffbe6;
  }
  .device-issue-content {
    color: #333;
    font-size: 0.98rem;
    line-height: 1.7;
    margin-top: 8px;
  }
  .bottom-card {
    margin-top: 18px;
  }
  .search-bar {
    margin-bottom: 0;
  }
  .center-panel {
  width: 33.33%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
}
.center-row {
  width: 100%;
  height: 50%;
}
.card-bj{
  background-image: url('/src/assets/images/cut331.png');
  height: 26px;
  padding-top:5px;
  margin-bottom: 4px;
}
.tcm1-mid-mid-card2-graph {
    height: 25vh;
    width: 100%;
    margin-top: 1vh;
    box-shadow: @box-shadow;
    border-radius: @border-radius;
  }
</style>
